package com.test;

import java.io.File;

import com.iamk.util.ListFilesUtil;

public class RenameMask {
	public static void main(String[] args) {
		ListFilesUtil lfu = new ListFilesUtil();
		lfu.listAllFiles("C:\\Users\\Ken\\Desktop\\Data-full\\mask\\");
		System.out.println("Size: " + lfu.arrAllFile.size());
		for(int i = 0; i < lfu.arrAllFile.size(); i++){
			File oldfile =new File(lfu.arrAllFile.get(i));
			File newfile =new File("C:\\Users\\Ken\\Desktop\\Data-full\\mask\\" + lfu.arrFileName.get(i).replace(".jpg", ""));
	 
			if(oldfile.renameTo(newfile)){
				System.out.println("Rename succesful");
			}else{
				System.out.println("Rename failed");
			}
		}
	}
}
